from .models import *
from rest_framework import serializers


class MenuSerializer(serializers.ModelSerializer):
    class Meta:
        model = Menu
        fields = '__all__'


class RoleSerializer(serializers.ModelSerializer):
    menu=MenuSerializer(many=True,read_only=True)
    class Meta:
        model = Roles
        fields = '__all__'

class UserSerializer(serializers.ModelSerializer):
    rid=serializers.StringRelatedField(many=True,read_only=True)
    class Meta:
        model=User
        fields='__all__'